from core.support import set_cutscene
from core.item import Item
from core.action import Action

class Scuba_Suit(Item):
    def __init__(self):
        Item.__init__(self, "scuba_suit")    # do basic initialization for every item
        self.is_lit = False
        
        # build list of actions
    
    def get_description(self):
            return "Scuba Suit"

class PutOn(Action):
    def __init__(self):
        Action.__init__(self, "Put_on")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Scuba Diving On"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "post"
    
    # enabled only if scuba diving is not wore.
    def is_enabled(self):
        if self.item.is_lit:
            return False
        else:
            return True
    
    # Put the cloth on and add cutscene
    def do_action(self,game,room,request):
        self.item.is_lit = True
        set_cutscene("You are wearing the scuba diving cloth, so you can dive under water.")
        return

class TakeOff(Action):
    def __init__(self):
        Action.__init__(self, "take_off")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Take out the scuba diving cloth"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "post"
    
    # enabled only if lamp is on.
    def is_enabled(self):
        if self.item.is_lit:
            return True
        else:
            return False
    
    # Put the cloth on and add cutscene
    def do_action(self,game,room,request):
        self.item.is_lit = False
        set_cutscene("You are not wearing the scuba diving cloth, so you can't dive under water.")
        return